package com.geek.javase.ch13.work.deepclone;

import java.io.Serializable;

/*
 *@author wangpeng
 *2025/10/27 21:18
 *@description TODO
 */
public class Phone implements Cloneable, Serializable {
    private String brand;
    private int price;

    /*@Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }*/
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return (Phone)super.clone();
    }

    public Phone(String brand, int price) {
        this.brand = brand;
        this.price = price;
    }

    public String getBrand() {
        return brand;
    }

    public int getPrice() {
        return price;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "brand='" + brand + '\'' +
                ", price=" + price +
                '}';
    }
}
